#pragma once

#include "BaseTypePublic.h"

namespace BaseType
{

class String;

struct BASE_TYPE_API Color
{
    Color()
    {
        _color = 0xFFFFFFFF;
    }

    Color(uint32_t clr) : _color(clr)
    {
    }

    Color(const Color& Other) : _color(Other._color)
    {
    }

    operator uint32_t()
    {
        return _color;
    }

    bool operator <(const Color& Other)
    {
        return _color < Other._color;
    }

    bool operator >(const Color& Other)
    {
        return _color > Other._color;
    }

    bool operator ==(const Color& Other)
    {
        return _color == Other._color;
    }

    Color operator=(const Color& Other)
    {
        _color = Other._color;
        return *this;
    }

    uint32_t ToRgb();
    uint32_t ToArgb();

    static uint32_t ToRgb(Color clr);
    static uint32_t ToArgb(Color clr);

    static uint8_t A(Color clr);
    static uint8_t R(Color clr);
    static uint8_t G(Color clr);
    static uint8_t B(Color clr);

    static String ToHex(Color clr);
    static String ToString(Color clr);

    static Color Parse(const String& strClr);

    static Color FromRgb(uint32_t val);
    static Color FromRgb(uint8_t r, uint8_t g, uint8_t b);
    static Color FromArgb(uint8_t a, uint8_t r, uint8_t g, uint8_t b);

private:

    uint32_t _color;
};

struct BASE_TYPE_API Colors
{
    static Color AliceBlue;
    static Color AntiqueWhite;
    static Color Aqua;
    static Color Aquamarine;
    static Color Azure;
    static Color Beige;
    static Color Bisque;
    static Color Black;
    static Color BlanchedAlmond;
    static Color Blue;
    static Color BlueViolet;
    static Color Brown;
    static Color BurlyWood;
    static Color CadetBlue;
    static Color Chartreuse;
    static Color Chocolate;
    static Color Coral;
    static Color CornflowerBlue;
    static Color Cornsilk;
    static Color Crimson;
    static Color Cyan;
    static Color DarkBlue;
    static Color DarkCyan;
    static Color DarkGoldenrod;
    static Color DarkGray;
    static Color DarkGreen;
    static Color DarkKhaki;
    static Color DarkMagenta;
    static Color DarkOliveGreen;
    static Color DarkOrange;
    static Color DarkOrchid;
    static Color DarkRed;
    static Color DarkSalmon;
    static Color DarkSeaGreen;
    static Color DarkSlateBlue;
    static Color DarkSlateGray;
    static Color DarkTurquoise;
    static Color DarkViolet;
    static Color DeepPink;
    static Color DeepSkyBlue;
    static Color DimGray;
    static Color DodgerBlue;
    static Color Firebrick;
    static Color FloralWhite;
    static Color ForestGreen;
    static Color Fuchsia;
    static Color Gainsboro;
    static Color GhostWhite;
    static Color Gold;
    static Color Goldenrod;
    static Color Gray;
    static Color Green;
    static Color GreenYellow;
    static Color Honeydew;
    static Color HotPink;
    static Color IndianRed;
    static Color Indigo;
    static Color Ivory;
    static Color Khaki;
    static Color Lavender;
    static Color LavenderBlush;
    static Color LawnGreen;
    static Color LemonChiffon;
    static Color LightBlue;
    static Color LightCoral;
    static Color LightCyan;
    static Color LightGoldenrodYellow;
    static Color LightGreen;
    static Color LightGray;
    static Color LightPink;
    static Color LightSalmon;
    static Color LightSeaGreen;
    static Color LightSkyBlue;
    static Color LightSlateGray;
    static Color LightSteelBlue;
    static Color LightYellow;
    static Color Lime;
    static Color LimeGreen;
    static Color Linen;
    static Color Magenta;
    static Color Maroon;
    static Color MediumAquamarine;
    static Color MediumBlue;
    static Color MediumOrchid;
    static Color MediumPurple;
    static Color MediumSeaGreen;
    static Color MediumSlateBlue;
    static Color MediumSpringGreen;
    static Color MediumTurquoise;
    static Color MediumVioletRed;
    static Color MidnightBlue;
    static Color MintCream;
    static Color MistyRose;
    static Color Moccasin;
    static Color NavajoWhite;
    static Color Navy;
    static Color OldLace;
    static Color Olive;
    static Color OliveDrab;
    static Color Orange;
    static Color OrangeRed;
    static Color Orchid;
    static Color PaleGoldenrod;
    static Color PaleGreen;
    static Color PaleTurquoise;
    static Color PaleVioletRed;
    static Color PapayaWhip;
    static Color PeachPuff;
    static Color Peru;
    static Color Pink;
    static Color Plum;
    static Color PowderBlue;
    static Color Purple;
    static Color Red;
    static Color RosyBrown;
    static Color RoyalBlue;
    static Color SaddleBrown;
    static Color Salmon;
    static Color SandyBrown;
    static Color SeaGreen;
    static Color SeaShell;
    static Color Sienna;
    static Color Silver;
    static Color SkyBlue;
    static Color SlateBlue;
    static Color SlateGray;
    static Color Snow;
    static Color SpringGreen;
    static Color SteelBlue;
    static Color Tan;
    static Color Teal;
    static Color Thistle;
    static Color Tomato;
    static Color Turquoise;
    static Color Violet;
    static Color Wheat;
    static Color White;
    static Color WhiteSmoke;
    static Color Yellow;
    static Color YellowGreen;
};

}

#define ARGB(a,r,g,b)  ((uint32_t)(((uint8_t)(b)|((uint16_t)((uint8_t)(g))<<8))|(((uint32_t)(uint8_t)(r))<<16)|(((uint32_t)(uint8_t)(a))<<24)))